<?php $this->load->view('scenic/layout/header') ?>
<div class="widthMax">
    <header class="vive-head" >
        <a href="<?php echo site_url('scenic/info/images/'.$sceneryBase->sid) ?>" class="vive-img">
            <img src="<?php echo $this->config->show_image_url($sceneryBase->minipics); ?>">
            <div class="vive-name flex flex-pack-justify">
                <p class="flex-1"><?php echo $sceneryBase->name_hanzi; ?></p>
                <span><?php echo count(explode('|', rtrim($sceneryBase->pics, '|'))); ?>张</span>
            </div>
        </a>
        <a href="javascript:goHistoryBack('<?php echo site_url('scenic/home/index');?>');" class="vive-return">
            <i class="iconfont">&#xe606;</i>
        </a>
        <div class="vive-function flex">
            <a href="javascript:;" class="view-product-enshrine vive-collect" data-sid="<?php echo $sceneryBase->sid ?>">
                <i class="iconfont">&#xe60f;</i>
            </a>
            <a class="sales-share vive-share" href="javascript:void(0)" data-link="<?php echo current_url();?>" data-name="<?php echo isset($headTitle) ? $headTitle : '一站式购物商城';?>">
                <i class="iconfont">&#xe603;</i>
            </a>
        </div>
    </header>
    <section class="vive-text">
        <a href="<?php echo site_url('scenic/info/map/'.$sceneryBase->sid) ?>" class="vive-location">
            <div class="flex flex-pack-justify">
                <i class="iconfont icon-left">&#xe600;</i>
                <p class="vive-textP flex-1">
                    <?php echo $sceneryBase->address; ?>
                </p>
                <i class="iconfont icon-right">&#xe606;</i>
            </div>
        </a>
        <a href="<?php echo $reviewsTotal ? site_url('scenic/info/reviews/'.$sceneryBase->sid) : 'javascript:;' ?>" class="vive-comment">
            <div class="flex flex-pack-justify">
                <p class="vive-textP flex-1">
                    <i class="iconfont">&#xe610;</i>查看全部评论（<?php echo $reviewsTotal;?>条）
                </p>
                <i class="iconfont icon-right">&#xe606;</i>
            </div>
        </a>
        <div class="vive-buy">
            <div class="am-tabs" data-am-tabs="{noSwipe:1}">
                <ul class="vive-nav am-tabs-nav flex" data-am-sticky>
                    <li class="am-active">
                        <a href="#buy1">
                            <i class="iconfont">&#xe613;</i>门票购买
                        </a>
                    </li>
                    <li>
                        <a href="#buy2">
                            <i class="iconfont">&#xe614;</i>预订须知
                        </a>
                    </li>
                    <li>
                        <a href="#buy3">
                            <i class="iconfont">&#xe612;</i>景区介绍
                        </a>
                    </li>
                </ul>
                <div class="am-tabs-bd">
                    <div class=" am-tab-panel am-fade am-in am-active scenic-list" id="buy1">
                    <?php foreach($goodsBase as $key=>$item): ?>
                        <dl class="vive-ticket">
                            <dt><i class="iconfont"><?php echo $cat_icon[$key]?></i><?php echo $cat_id[$key]; ?></dt>
                            <?php foreach($item as $val): ?>
                                <dd>
                                    <h5>
                                        <?php echo $val->goods_name; ?>
                                    </h5>
                                    <div class="flex flex-pack-justify">
                                        <div class="vive-list flex-1"  data-am-modal="{target: '#doc-modal-<?php echo $val->goods_id; ?>'}">
                                             <p class="am-cf">
                                                <?php if ($val->advance_date == 0) :?>
                                                    <span><?php echo !empty($val->advance_time) ? $val->advance_time.'前': '';?>可订今日票<?php echo $val->use_start_day > 0 ? '预订'.(int)$val->use_start_day.'小时后生效' : ''; ?></span>
                                                <?php elseif ($val->advance_date > 0) : ?>
                                                    <span>提前<?php echo $val->advance_date?>天<?php echo (!empty($val->advance_time)) ? $val->advance_time.'前' : '';?><?php echo $val->use_start_day > 0 ? '预订'.(int)$val->use_start_day.'小时后生效' : ''; ?></span>
                                                <?php endif;?>
                                            </p>
                                            <div class="vive-price flex">
                                                <div class="flex-1">
                                                    <?php if ($val->off_bonus > 0) : ?>
                                                    <p class="vive-rmb flex">
                                                        <i>抵</i>
                                                        <span>积分<?php echo $val->off_bonus ?>枚</span>
                                                    </p>
                                                    <?php endif;?>
                                                </div>
                                                <i><span>￥</span><?php echo $val->shop_price; ?></i>
                                            </div>
                                            <div class="vive-work flex">
                                                <p>已售：<?php echo $val->sold_number; ?></p>
                                                <div class="vive-spec flex-1 am-cf">
                                                    <span>票类说明</span>
                                                    <i class="iconfont">&#xe606;</i>
                                                </div>
                                                <s>￥<?php echo $val->market_price; ?></s>
                                            </div>
                                        </div>
                                        <div class="vive-book">
                                            <a href="<?php echo site_url('scenic/checkout/confirm').'?scenicId='.$sceneryBase->sid.'&ticketId='.$val->goods_id; ?>" class="vive-rese <?php if($this->isAppHeader==1): ?>app-buy<?php endif;?>" goods-id="<?php echo $val->goods_id;?>" sid="<?php echo $val->sid;?>">
                                                <span class="rese-reb">预订</span>
                                                <span class="rese-line">在线预订</span>
                                            </a>
                                        </div>
                                    </div>
                                </dd>
                            <?php endforeach; ?>
                        </dl>
                    <?php endforeach; ?>
                    </div>
                    <div class="vive-alert am-tab-panel am-fade" id="buy2">
                        <div class="vive-know">
                            <h1>温馨提示</h1>
                            <div class="know-text">
                                <?php echo $sceneryBase->guidelines; ?>
                            </div>
                        </div>
                    </div>
                    <div class="vive-induce am-tab-panel am-fade" id="buy3">
                        <div class="vive-know">
                            <h1>景区详情</h1>
                            <div class="know-text know-hide">
                                <?php echo mb_substr(strip_tags($sceneryBase->info),0,140,'UTF-8'); ?>
                            </div>
                            <div class="know-more" id="show-more">
                                <div class="know-load">显示更多</div>
                            </div>
                            <h1>交通指南</h1>
                            <div class="know-text">
                                <?php echo strip_tags($sceneryBase->traffic); ?>
                            </div>
                            <h1>注意事项</h1>
                            <div class="know-text">
                                <?php echo strip_tags($sceneryBase->notice); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <?php if ($scenicNearby->num_rows() > 0): ?>
        <div class="vive-recom">
            <h6>看了此景点的人还看了</h6>
            <ul class="am-cf vive-listS">
                <?php foreach($scenicNearby->result() as $value): ?>
                <li>
                    <a href="<?php echo site_url('scenic/info/index/'.$value->sid); ?>">
                        <img class="lazy" src="/skins/scenic/images/load.jpg" data-original="<?php echo $this->config->show_image_url($value->minipics); ?>">
                        <p><?php echo $value->name_hanzi;?></p>
                        <div class="listS-price">
                            <i>
                                <span>￥</span><?php echo $value->shop_price; ?><span class="listS-rise">起</span>
                            </i>
                            <s><?php echo $value->market_price; ?></s>
                        </div>
                    </a>
                </li>
                <?php endforeach; ?>
            </ul>
        </div>
        <?php endif; ?>
    </section>
</div>
<?php foreach($goodsBase as $value): ?>
    <?php foreach($value as $ticket): ?>
    <div class="vive-Alert am-modal" tabindex="-1" id="doc-modal-<?php echo $ticket->goods_id;?>">
        <h4 class="alert-head flex flex-pack-justify">
            <p class="alert-explain flex-1">票类说明</p>
            <a href="javascript: void(0)" class="am-close alert-close" data-am-modal-close>&times;</a>
        </h4>
        <div class="alert-exact">
            <h6>提前预订时间</h6>
            <?php if ($ticket->advance_date == 0) :?>
                <p>您最晚要在游玩前当天<?php echo !empty($ticket->advance_time) ? $ticket->advance_time.'前': '23:59前';?>下单，<?php echo $ticket->use_start_day > 0 ? '预定'.(int)$ticket->use_start_day.'小时后生效，' : '' ?>请尽早预订，以免耽误行程。</p>
            <?php elseif ($ticket->advance_date > 0) : ?>
                <p>您最晚要在游玩前<?php echo $ticket->advance_date ?>天<?php echo (!empty($ticket->advance_time)) ? $ticket->advance_time.'前' : '23:59前';?>下单，<?php echo $ticket->use_start_day > 0 ? '预定'.(int)$ticket->use_start_day.'小时后生效，' : '' ?>请尽早预订，以免耽误行程。</p>
            <?php endif;?>
            <h6>包含项目</h6>
            <p><?php echo $ticket->goods_containe_item ?></p>
            <h6>入园方式</h6>
            <p><?php echo $ticket->goods_park_mode ?></p>
            <h6>退改说明</h6>
            <p><?php echo $ticket->goods_refund_info; ?></p>
        </div>
        <div class="alert-foot flex flex-pack-justify">
            <i class="alert-explain flex-1">
                <span>￥</span><?php echo $ticket->shop_price; ?>
            </i>
            <a href="<?php echo site_url('scenic/checkout/confirm').'?scenicId='.$ticket->sid.'&ticketId='.$ticket->goods_id; ?>" class="alert-buy">预订</a>
        </div>
    </div>
    <?php endforeach ?>
<?php endforeach ?>
<?php $this->load->view('scenic/layout/share');?>
<?php $this->load->view('scenic/layout/footer') ?>
<script type="text/javascript">
    function getInfo() {
        var str = '<?php echo str_replace(array("\n","\r","\r\n"),"",strip_tags($sceneryBase->info,"<img>")); ?>';
        return str;
    }
</script>